//
//  BaseViewController.m
//  30303
//
//  Created by student on 16/3/18.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageview;

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    //    CABasicAnimation *anim1 = [CABasicAnimation animationWithKeyPath:@"opacity"];
    //    anim1.duration = 2.0; // 动画过程的时间
    //    anim1.fromValue = @1; // 起始值
    //    anim1.toValue = @0;   // 终止值
    //    anim1.repeatCount = 1; // 次数
    //    anim1.fillMode = kCAFillModeRemoved; // 保持动画最后的数值 ?
    //
    //    [self.plane.layer addAnimation:anim1 forKey:@"animate1"];
    
    //    CABasicAnimation *anim2 = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
    //    anim2.duration = 1.0; // 动画过程的时间
    //    anim2.fromValue = @0.1; // 起始值
    //    anim2.toValue = @2;   // 终止值
    //    anim2.repeatCount = 1; // 次数
    //
    //    [self.plane.layer addAnimation:anim2 forKey:@"animate2"];

    CABasicAnimation *anim3=[CABasicAnimation animationWithKeyPath:@"contents"];
    anim3.duration=1.0;
    anim3.fromValue=(id)[UIImage imageNamed:@"clipartPlane"].CGImage;
    anim3.toValue=(id)[UIImage imageNamed:@"Icon"].CGImage;
    anim3.repeatCount=3;
    anim3.fillMode=kCAFillModeForwards;
    
    anim3.removedOnCompletion=NO;
    [self.imageview.layer addAnimation:anim3 forKey:@"animate3"];
}
@end
